<?php

// 控制器基类
class Controller 
{

	public $data = [];
	public function display($tempName=null)
	{
		// $oldData = [];
		// 把数组分解成变量
		extract($this->data);

		if($tempName){
			include VIEW_PATH."/".strtolower(CONTROLLER_NAME).'/'.$tempName.'.html';
		}else{
			include VIEW_PATH."/".strtolower(CONTROLLER_NAME).'/'.ACTION_NAME.'.html';
		}
	}
	public function assign($key,$value)
	{
		$this->data[$key] = $value;
	}
}